<?php

Yii::import('ext.search.DbSearchAdapter');

class SearchService extends AbstractService
{

    private $_searchAdapter;

    public function __call($name, $arguments)
    {
	return call_user_func_array(array($this->getSearchAdapter(), $name), $arguments);
    }

    protected function _init()
    {
	$this->getSearchAdapter();
    }

    public function getSearchAdapter()
    {
	if ($this->_searchAdapter === null) {
	    $this->_searchAdapter = new DbSearchAdapter(Yii::app()->db);
	}
	return $this->_searchAdapter;
    }

}
